home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir42 / gnudbm14.zip / NDBM.H < prev    next >
C/C++ Source or Header  |  1990-08-24  |  3KB  |  97 lines

  1. /* ndbm.h  -  The include file for ndbm users.  */
  2.  
  3. /*  This file is part of GDBM, the GNU data base manager, by Philip A. Nelson.
  4.     Copyright (C) 1990  Free Software Foundation, Inc.
  5.  
  6.     GDBM is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; either version 1, or (at your option)
  9.     any later version.
  10.  
  11.     GDBM is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with GDBM; see the file COPYING.  If not, write to
  18.     the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20.     You may contact the author by:
  21.        e-mail:  phil@wwu.edu
  22.       us-mail:  Philip A. Nelson
  23.                 Computer Science Department
  24.                 Western Washington University
  25.                 Bellingham, WA 98226
  26.         phone:  (206) 676-3035
  27.        
  28. *************************************************************************/
  29.  
  30. /*
  31.  * MS-DOS port (c) 1990 by Thorsten Ohl, td12@@ddagsi3.bitnet
  32.  *
  33.  * To this port, the same copying conditions apply as to the
  34.  * original release.
  35.  *
  36.  * IMPORTANT:
  37.  * This file is not identical to the original GNU release!
  38.  * You should have received this code as patch to the official
  39.  * GNU release.
  40.  *
  41.  * MORE IMPORTANT:
  42.  * This port comes with ABSOLUTELY NO WARRANTY.
  43.  *
  44.  * $Header: e:/gnu/gdbm/RCS/ndbm.h'v 1.4.0.1 90/08/16 09:23:06 tho Exp $
  45.  */
  46.  
  47. /* Parameters to dbm_store for simple insertion or replacement. */
  48. #define  DBM_INSERT  0
  49. #define  DBM_REPLACE 1
  50.  
  51.  
  52. /* The data and key structure.  This structure is defined for compatibility. */
  53. #ifdef __STDC__
  54. #include "gdbmdefs.h"
  55. #else /* not __STDC__ */
  56. typedef struct {
  57.     char *dptr;
  58.     int   dsize;
  59.       } datum;
  60. #endif /* not __STDC__ */
  61.  
  62. /* The file information header. This is good enough for most applications. */
  63. #ifdef __STDC__
  64. #define DBM gdbm_file_info
  65. #else /* not __STDC__ */
  66. typedef struct {int dummy[10];} DBM;
  67. #endif /* not __STDC__ */
  68.  
  69. /* These are the routines (with some macros defining them!) */
  70.  
  71. #ifdef __STDC__
  72. extern DBM *dbm_open (char *file, int flags, int mode);
  73. extern void dbm_close (DBM *dbf);
  74. extern datum dbm_fetch (DBM *dbf, datum key);
  75. extern int dbm_store (DBM *dbf, datum key, datum content, int flags);
  76. extern int dbm_delete (DBM *dbf, datum key);
  77. extern datum dbm_firstkey (DBM *dbf);
  78. extern datum dbm_nextkey (DBM *dbf);
  79. extern int dbm_dirfno (DBM *dbf);
  80. extern int dbm_pagfno (DBM *dbf);
  81. #else /* not __STDC__ */
  82. extern DBM     *dbm_open ();
  83. extern void     dbm_close ();
  84. extern datum     dbm_fetch ();
  85. extern int     dbm_store ();
  86. extern int     dbm_delete ();
  87. extern datum     dbm_firstkey ();
  88. extern datum     dbm_nextkey ();
  89. extern int     dbm_dirfno ();
  90. extern int     dbm_pagfno ();
  91. #endif /* not __STDC__ */
  92.  
  93. #define         dbm_error(dbf)  0
  94. #define         dbm_clearerr(dbf)
  95.  
  96.  
  97.